Non Patent Literature (NPL) 1 discloses a general-purpose video encoding technique based on a transform encoding technique, a prediction encoding technique, and an entropy encoding technique.
An example of a block type that is not subject to a transform process and an entropy encoding process is pulse code modulation (PCM). The term “block type” means a type of encoding (intra prediction, inter prediction, PCM) used for a block.
A video encoding device described in NPL 1 has a structure depicted in FIG. 25. The video encoding device depicted in FIG. 25 is hereafter referred to as “typical video encoding device”.
The structure and operation of the typical video encoding device that receives each frame of digitized video as input and outputs a bitstream are described below, with reference to FIG. 25.
The video encoding device depicted in FIG. 25 includes a transformer/quantizer 102, an entropy encoder 103, an inverse transformer/inverse quantizer 104, a buffer 105, a predictor 106, a PCM encoder 107, a PCM decoder 108, a multiplexed data selector 109, a multiplexer 110, a switch 121, and a switch 122.
As depicted in FIG. 26, each frame includes largest coding units (LCUs), and each LCU includes coding units (CUs).
The video encoding device depicted in FIG. 25 encodes the LCUs in raster scan order, and the CUs included in each LCU in z-scan order. In detail, the CUs are encoded in order of “upper left block→upper right block→lower left block→lower right block”. The CU size is any of 64×64, 32×32, 16×16, and 8×8. The smallest CU is referred to as “smallest coding unit (SCU)”.
A prediction signal supplied from the predictor 106 is subtracted from input video of a CU, and the result is input to the transformer/quantizer 102. There are two types of prediction signal, namely, an intra prediction signal and an inter-frame prediction signal. Each of the prediction signals is described below. The intra prediction signal is a prediction signal created based on an image of a reconstructed picture that has the same display time as a current picture and is stored in the buffer 105. A CU encoded using the intra prediction signal is hereafter referred to as “intra CU”.
The inter-frame prediction signal is a prediction signal created from an image of a reconstructed picture that has a different display time from the current picture and is stored in the buffer 105. A CU encoded using the inter-frame prediction signal is hereafter referred to as “inter CU”.
FIG. 27 is an explanatory diagram depicting an example of inter-frame prediction using a 16×16 CU (specifically, a 2N×2N prediction unit (PU) of a 16×16 CU). A motion vector MV=(mvx, mvy) depicted in FIG. 27 is a prediction parameter of inter-frame prediction, which indicates the amount of translation of an inter-frame prediction block (inter-frame prediction signal) of a reference picture relative to a block to be encoded.
A picture encoded including only intra CUs is called “I picture”. A picture encoded including not only intra CUs but also inter CUs is called “P picture”. A picture encoded including inter CUs that use not only one reference picture but two reference pictures simultaneously for inter-frame prediction is called “B picture”.
The transformer/quantizer 102 frequency-transforms the image (prediction error image) from which the prediction signal has been subtracted, to obtain a frequency transform coefficient of the prediction error image.
The transformer/quantizer 102 further quantizes the frequency transform coefficient with a predetermined quantization step width Qs. The quantized frequency transform coefficient is hereafter referred to as “transform quantization value” or “quantization level”.
The entropy encoder 103 entropy-encodes prediction parameters and the transform quantization value. The prediction parameters are information related to the prediction of the CU and the PU included in the CU, such as the above-mentioned CU block type (intra prediction, inter prediction, PCM), motion vector, and the like.
The inverse transformer/inverse quantizer 104 inverse-quantizes the transform quantization value with the quantization step width Qs. The inverse transformer/inverse quantizer 104 further inverse-frequency-transforms the frequency transform coefficient obtained by the inverse quantization. The prediction signal is added to the reconstructed prediction error image obtained by the inverse frequency transform, and the result is supplied to the switch 122.
The multiplexed data selector 109 monitors the amount of input data of the entropy encoder 103 corresponding to the CU to be encoded. In the case where the entropy encoder 103 is capable of entropy-encoding the input data within the processing time of the CU, the multiplexed data selector 109 selects the output data of the entropy encoder 103, and supplies the output data to the multiplexer 110 via the switch 121. The multiplexed data selector 109 further selects the output data of the inverse transformer/inverse quantizer 104, and supplies the output data to the buffer 105 via the switch 122.
In the case where the entropy encoder 103 is not capable of entropy-encoding the input data within the processing time of the CU, the multiplexed data selector 109 selects the output data of the PCM encoder 107, and supplies the output data to the multiplexer 110 via the switch 121. The multiplexed data selector 109 further selects the output data of the PCM decoder 108 obtained by PCM-decoding the output data of the PCM encoder 107, and supplies the output data to the buffer 105 via the switch 122.
The buffer 105 stores the reconstructed image supplied via the switch 122. The reconstructed image per frame is referred to as “reconstructed picture”.
The multiplexer 110 multiplexes the output data of the entropy encoder 103 and the output data of the PCM encoder 107, and outputs the multiplexing result.
Based on the operation described above, the multiplexer 110 in the video encoding device creates the bitstream.